import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
import Index from './pages/index';
import DetailsPage from './pages/details';


export default function Routers() {
  return (
    <Router>
      <div>
        {/* A <Switch> looks through its children <Route>s and
              renders the first one that matches the current URL. */}
        <Switch>
          <Route path="/details/:id">
            <DetailsPage></DetailsPage>
          </Route>

          <Route path="/">
            <Index></Index>
          </Route>
        </Switch>
      </div>
    </Router>
  );
}
